package no.zsoft.faktura.admin.web;

import java.io.Serializable;
import java.util.List;

import no.zsoft.faktura.admin.domain.User;
import no.zsoft.faktura.admin.service.UserServices;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller
@Scope("session")
public class UserController implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private List<User> users;
	
	@Autowired
	UserServices userServices;
	
	public void getAllUsers(){
		setUsers(userServices.getAllUsers());
		System.err.println(users.get(0).getRoles());
	}

	/**
	 * @return the users
	 */
	public List<User> getUsers() {
		return users;
	}

	/**
	 * @param users the users to set
	 */
	public void setUsers(List<User> users) {
		this.users = users;
	}
	
}
